package city.spring.modules.work.repository;

import city.spring.modules.work.entity.WorkPlanShiftExtEntity;
import city.spring.modules.work.entity.WorkPlanUserExtEntity;
import city.spring.modules.work.vo.WorkPlanUserVO;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 存储库：排班方案-关联用户
 *
 * @author 侯坤林
 * @date 2020-06-04 16:25:19
 */
@Repository
public interface WorkPlanUserExtRepository extends BaseMapper<WorkPlanUserExtEntity> {
    /**
     * 获取方案的用户列表
     *
     * @param wrapper 查询对象
     * @return
     */
    List<WorkPlanUserVO> getUsers(@Param(Constants.WRAPPER) Wrapper<? extends WorkPlanShiftExtEntity> wrapper);

    /**
     * 获取方案的用户列表
     *
     * @param planId 排班方案ID
     * @return
     */
    List<WorkPlanUserVO> getPlanUsers(String planId);

    /**
     * 获取方案的某个用户
     *
     * @param planId 排班方案ID
     * @param extId  主键ID
     * @return
     */
    WorkPlanUserVO getPlanUser(String planId, Long extId);
}